// mainloop

// capture --> osd --> ecode

#ifndef _VIDEO_H_
#define _VIDEO_H_

struct ctx_image_data
{
    u_char *data;

    int width;
    int height;

    int size;
};

class cls_video
{
public:
    cls_video(cls_spkcam *p_app);
    ~cls_video();

    cls_spkcam *app;
    device_info *cfg_src;
    device_info *cfg_cur;

    ctx_image_data img_org;
    ctx_image_data img_osd;

    bool video_running;

    std::unique_ptr<std::thread> main_loop_thread;

    void video_main_loop(); // v4l2 --> osd --> mpp --> queue
    void video_loop_start();
    void video_loop_stop();

private:
    cls_video_v4l2 *video_v4l2;
    cls_video_mpp *video_mpp;
    cls_video_osd *video_osd;

    void init_images();
    void free_images();
};

#endif //  _VIDEO_H_